{
    rules+: [
        {
            // 网卡接收状态下错误数
            alert: 'NodeNetworkReceiveErrs',
            annotations: {
                message: '{{ $labels.instance }} interface {{ $labels.device }} has encountered {{ printf "%.0f" $value }} receive errors in the last two minutes.',
                summary: 'Network interface is reporting many receive errors.',
                runbook: $._config.runbook,
            },
            expr: |||
              rate(node_network_receive_errs_total[2m]) / rate(node_network_receive_packets_total[2m]) > 0.01
            |||,
            'for': '1h',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 网卡网络吞吐量接收异常
            alert: 'NodeUnusualNetworkThroughputIn',
            annotations: {
                message: '网络接口接收数据异常 (> 100 MB/s)  当前值 = {{ $value }}  告警主机: {{ $labels.instance }}.',
                summary: 'Node unusual network throughput in (instance {{ $labels.instance }}).',
                runbook: $._config.runbook,
            },
            expr: |||
              sum by (instance) (rate(node_network_receive_bytes_total[2m])) / 1024 / 1024 > 100
            |||,
            'for': '5m',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 网卡网络吞吐量发送异常
            alert: 'NodeUnusualNetworkThroughputOut',
            annotations: {
                message: '网络接口发送数据异常 (> 100 MB/s)  当前值 = {{ $value }}  告警主机: {{ $labels.instance }}.',
                summary: 'Node unusual network throughput out (instance {{ $labels.instance }}).',
                runbook: $._config.runbook,
            },
            expr: |||
              sum by (instance) (rate(node_network_transmit_bytes_total[2m])) / 1024 / 1024 > 100
            |||,
            'for': '5m',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 网卡接口已饱和
            alert: 'NodeNetworkInterfaceSaturated',
            annotations: {
                message: '网卡接口 "{{ $labels.interface }}" on "{{ $labels.instance }}" 已超载.  当前值 = {{ $value }}  告警主机: {{ $labels.instance }}.',
                summary: 'Host Network Interface Saturated (instance {{ $labels.instance }}).',
                runbook: $._config.runbook,
            },
            expr: |||
              (rate(node_network_receive_bytes_total{device!~"^tap.*"}[1m]) + rate(node_network_transmit_bytes_total{device!~"^tap.*"}[1m])) / node_network_speed_bytes{device!~"^tap.*"} > 0.8
            |||,
            'for': '1m',
            labels: {
                severity: 'warning'
            },
        },
         {
            // 网卡发送状态下错误数
            alert: 'NodeNetworkTransmitErrs',
            annotations: {
                message: '{{ $labels.instance }} interface {{ $labels.device }} has encountered {{ printf "%.0f" $value }} transmit errors in the last two minutes.',
                summary: 'Network interface is reporting many transmit errors.',
                runbook: $._config.runbook,
            },
            expr: |||
              rate(node_network_transmit_errs_total[2m]) / rate(node_network_transmit_packets_total[2m]) > 0.01
            |||,
            'for': '1h',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 路由跟踪条目Conntrack监控
            alert: 'NodeHighNumberConntrackEntriesUsed',
            annotations: {
                message: '{{ $value | humanizePercentage }} of conntrack entries are used.',
                summary: ' Number of conntrack are getting close to the limit.',
                runbook: $._config.runbook,
            },
            expr: |||
              (node_nf_conntrack_entries / node_nf_conntrack_entries_limit) > 0.75
            |||,
            'for': '1h',
            labels: {
                severity: 'warning'
            },
        },
    ],
}
